# 【练习】猜拳游戏
# 编写一个Python程序，实现一个简单的猜拳游戏。玩家和电脑各自选择石头、剪刀或布，根据规则判断胜负关系，并输出比赛结果。
import random
def guessing_game(guessing):
    if guessing not in ("石头", "剪刀", "布"):
        return "无效"
    computer = random.choice(["石头", "剪刀", "布"])
    if(guessing == computer):
        return f"平局(电脑：{computer})"
    elif(guessing == "石头" and computer == "剪刀"):
        return f"你赢了(电脑：{computer})"
    elif(guessing == "剪刀" and computer == "布"):
        return f"你赢了(电脑：{computer})"
    elif (guessing == "布" and computer == "石头"):
        return f"你赢了(电脑：{computer})"
    else:
        return f"你输了(电脑：{computer})"
if __name__ == "__main__":
    print(guessing_game("石头"))